package org.jfk.sys.user;

import org.apache.log4j.Logger;
import org.jfk.core.model.BaseModel;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Table;
import com.jfinal.plugin.activerecord.TableMapping;

/**
 * 
 * @author jxf
 * 2015年8月21日
 */

@SuppressWarnings("serial")
public class UserRole extends  BaseModel<UserRole> {
	private static Logger logger = Logger.getLogger(UserRole.class);	
	public static final UserRole dao;
	public static final Table table;
	public static final String tableName;
	static {
		dao = new UserRole();
		table = TableMapping.me().getTable(UserRole.class);
		tableName = table.getName();
	}
	
	public boolean delUserRole(int userId,int roleId){
		return Db.update("delete from "+tableName+" where userId = ? and roleId = ?",userId,roleId) > 0;
	}
}
